Skip to content

Docs: recommend disabling Nagle's algorithm on the MQTT server - #422

Closed
jamesmulcahy wants to merge 1 commit into
NSPManager:develfrom
jamesmulcahy:docs/mqtt-tcp-nodelay
Closed

jamesmulcahy wants to merge 1 commit into
NSPManager:develfrom
jamesmulcahy:docs/mqtt-tcp-nodelay

Conversation

@jamesmulcahy

@jamesmulcahy jamesmulcahy commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Adds a tip to Getting started → Pre-requisites recommending that Nagle's algorithm be turned off on the MQTT server, and how to do it in Mosquitto (set_tcp_nodelay true, 2.0+).

Why

Nearly every MQTT message between the manager and the panels is small. With Nagle's algorithm on, TCP holds a small packet back until the data sent before it has been acknowledged, and the other side delays its ACKs, so small messages can wait tens to hundreds of milliseconds.

Measured on one panel switching rooms. The time is from the panel subscribing to a room or entities-page topic until the broker's retained value arrives:

Room state Entities page Worst case
Nagle on at both ends ~50 ms ~55 ms 150–300 ms, often
Off on the panel only (NSPManager/NSPanelManager-firmware#59) ~22 ms ~45 ms 100–240 ms spikes remain
Off on the panel and the broker ~22 ms ~45 ms 134 ms, none over 200 ms

The panel side is handled in the firmware (NSPManager/NSPanelManager-firmware#59). The broker side is a setting users have to change themselves, hence this tip.

Notes

  • It doesn't recommend Mosquitto specifically, only how to make the change if you use it.
  • It says the option needs Mosquitto 2.0 or newer: 1.x doesn't recognise set_tcp_nodelay and refuses to start.
  • I didn't build the Docusaurus site locally. The markup copies the existing :::tip blocks in web-interface.md.

🤖 Generated with Claude Code

Most MQTT messages between the manager and the panels are small, and with
Nagle's algorithm on, the broker holds each one back until the data before it
has been acknowledged. On a real panel this delayed the replies to the
subscriptions made when switching rooms by up to ~240 ms. Add a tip to the
pre-requisites page recommending turning it off, and how to do it in
Mosquitto (set_tcp_nodelay, 2.0+). The panel side is handled in the firmware
(NSPManager/NSPanelManager-firmware#59).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jamesmulcahy

Copy link
Copy Markdown
Contributor Author

Moved to NSPManager/NSPanelManager-docs#173. The live site at nspanelmanager.com is built from that repo; the docs/ folder here isn't built or published any more (its workflows were disabled in ae6b126), so changes here never reach users. It may be worth removing docs/ from this repo to avoid the same confusion in future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant